import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/esm/inherits";

var _class, _temp;

import React from "react";
import intl from "cpaas-front/lib/utils/intl";
import { BlockContainer } from "./index.style";
import SectionTitle from "../_components/SectionTitle";
import ConfigItem from "../_components/ConfigItem";
import withFormOperate from "../_components/withFormOperate";
import { getMemoizedAssets } from "./util";

var PopConfirm = withFormOperate(_class = (_temp = /*#__PURE__*/function (_React$Component) {
  _inherits(PopConfirm, _React$Component);

  function PopConfirm() {
    var _getPrototypeOf2;

    var _this;

    _classCallCheck(this, PopConfirm);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(PopConfirm)).call.apply(_getPrototypeOf2, [this].concat(args)));
    _this.getPopTip = getMemoizedAssets(_this.props.styleCounts.popconfirm, "feedback/poptip");
    _this.getModal = getMemoizedAssets(_this.props.styleCounts.modal, "feedback/modal");
    return _this;
  }

  _createClass(PopConfirm, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          handleChange = _this$props.handleChange,
          value = _this$props.value,
          schema = _this$props.schema;
      return React.createElement(BlockContainer, {
        id: "pop-confirm-config"
      }, React.createElement(SectionTitle, {
        title: "\u53CD\u9988",
        titleTail: "Operation hint"
      }), React.createElement(ConfigItem, {
        cols: 2,
        title: intl.get("cpaas.cpaasTheme.page.popConfirm").d("气泡确认"),
        items: this.getPopTip(schema),
        onChange: handleChange("popconfirm"),
        defaultSelected: value.popconfirm
      }), React.createElement(ConfigItem, {
        cols: 2 // title="Modal 模态框"
        ,
        title: intl.get("cpaas.cpaasTheme.page.modalBox").d("模态框弹出"),
        items: this.getModal(schema),
        onChange: handleChange("modal"),
        defaultSelected: value.modal
      }));
    }
  }]);

  return PopConfirm;
}(React.Component), _temp)) || _class;

export { PopConfirm as default };
